/**
* Oxide
*
* Copyright (c) 2011 Dinosaur Kick Pty Ltd, All rights reserved.
*
* This source code is made available under the "Modified BSD" licensing arrangement.
* See license.txt for details.
*/
// ----------------------------------------------------------------------------
#include <functional>
#include "../token.hpp"
// ----------------------------------------------------------------------------
#ifndef O2_PARSE_TOKEN_COMPARITOR_INC
#define O2_PARSE_TOKEN_COMPARITOR_INC
namespace o2 {
namespace parse {
namespace detail {
// ----------------------------------------------------------------------------

template <typename StringT>
struct token_comparator
	: public std::binary_function<basic_token<StringT>, token_identity, int>
{
	int operator() (const basic_token<StringT>& left, token_identity right) const
	{
		return left.identity - right;
	}
};

// ----------------------------------------------------------------------------
} // namespace detail
} // namespace parse
} // namespace o2
#endif // O2_PARSE_TOKEN_COMPARITOR_INC
// ----------------------------------------------------------------------------
